import { axiosGet, axiosPost, axiosPut, axiosDelete } from '/@/api/RequestBase';
import { SqlSugarPagedList } from '/@/api/BaseDto';
import { BaseKeywordPageInput } from '/@/api/BaseDto';

import { BasXueYePinZhongInput } from './dto/BasXueYePinZhongInput';
import { BasXueYePinZhongOutput } from './dto/BasXueYePinZhongOutput';
import { BasXueYePinZhongAllOutput } from './dto/BasXueYePinZhongAllOutput';

export type { BasXueYePinZhongInput, BasXueYePinZhongOutput, BasXueYePinZhongAllOutput };

const service = 'BasXueYePinZhong/'; // 要写后面的斜杠, 不要写前面的斜杠

export const BasXueYePinZhongApi = {
	page: (data: BaseKeywordPageInput) => {
		return axiosPost<SqlSugarPagedList<BasXueYePinZhongOutput>>(service + 'page', data);
	},
	all: () => {
		return axiosPost<BasXueYePinZhongAllOutput[]>(service + 'all', {});
	},
	get: (id: number) => {
		return axiosGet<BasXueYePinZhongOutput>(service + `get/${id}`);
	},
	add: (data: BasXueYePinZhongInput) => {
		return axiosPost<number>(service + 'add', data);
	},
	update: (data: BasXueYePinZhongInput) => {
		return axiosPut<boolean>(service + 'update', data);
	},
};
